Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First of all: Thanks for the great project! I really like the approach and have seen great performance improvements with vtprotobuf.
While analysing the memory usage of my program using vtprotobuf, I noticed that massive amounts of memory are used for the allocation of
unknownFields
. This is a big part of my data, as I am parsing some existing protobuf (open streetmap's PBF files) where I don't care about a lot of the fields, so I have excluded them from my .proto files to increase performance. Reusing the memory of theunknownFields
reduced the amount of allocations by 34% and the amount of used memory by 41% in my case.I'm pretty sure this PR is in no shape to be merged, because I still understand too little about the code to write it better, but thought a working PR would demonstrate my idea better than an issue.